package com.nlscan.ncomgateway.core.common

object AppStateHelper {

    fun getIpProtocolArrayIndex(ipProtocol: String) =
        AppState.IP_OUTPUT_PROTOCOL_LIST.indexOf(ipProtocol)

    fun getHttpRequestMethodListIndex(method: String) =
        AppState.HTTP_REQUEST_METHOD_LIST.indexOf(method)

    fun isHttpOrHttpsOutputMode(ipProtocol: String): Boolean {
        return AppState.IP_OUTPUT_PROTOCOL_HTTP == ipProtocol
                || AppState.IP_OUTPUT_PROTOCOL_HTTPS == ipProtocol
    }

    fun isHttpGetRequest(requestMethod: String) =
        AppState.HTTP_REQUEST_METHOD_GET == requestMethod

}